package org.cainiao.io.netty.other.buffer.reference;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.Channel;

/**
 * <br />
 * <p>
 * Author: Cai Niao(wdhlzd@163.com)<br />
 */
public class CommonTest {

    public static void main(String[] args) {
        f();
    }

    private static void f() {
        Channel channel = null;
        ByteBufAllocator allocator = channel.alloc();
        // ...
        ByteBuf buffer = allocator.directBuffer();
        assert buffer.refCnt() == 1;
        // ...

        boolean released = buffer.release();
        // ...
    }

}
